﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[customer]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[customer](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[customerId] [varchar](50) NOT NULL,
	[customerName] [varchar](50) NOT NULL,
	[idCard] [varchar](50) NULL,
	[companyName] [varchar](100) NULL,
	[province] [varchar](50) NULL,
	[city] [varchar](100) NULL,
	[phone] [varchar](50) NULL,
	[mobile] [varchar](50) NOT NULL,
	[QQ] [varchar](50) NULL,
	[email] [varchar](50) NULL,
	[birthday] [varchar](20) NULL,
	[isNew] [int] NOT NULL,
	[userSno] [varchar](50) NOT NULL,
	[position] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[signature] [int] NULL CONSTRAINT [DF_customer_signature]  DEFAULT ((0)),
	[signTime] [varchar](20) NULL,
	[roleId] [varchar](2000) NULL,
	[createTime] [varchar](50) NULL,
	[modifyTime] [varchar](50) NULL,
	[memo] [varchar](1000) NULL,
	[amount] [varchar](20) NULL,
	[payTime] [varchar](20) NULL,
	[type] [varchar](20) NULL,
 CONSTRAINT [PK_customer] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[yyuser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[yyuser](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](100) NOT NULL,
	[phone] [varchar](50) NULL,
	[email] [varchar](100) NULL,
	[address] [varchar](100) NULL,
	[content] [varchar](500) NULL,
	[bmtime] [varchar](20) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](500) NULL,
	[userSno] [varchar](200) NULL,
 CONSTRAINT [PK_yyuser] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[userRole]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[userRole](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[roleId] [varchar](50) NOT NULL,
	[parentId] [varchar](50) NOT NULL,
	[roleName] [varchar](50) NOT NULL,
	[actionPermission] [varchar](500) NULL,
 CONSTRAINT [PK_userRole] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[company]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[company](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[companyId] [varchar](50) NOT NULL,
	[companyName] [varchar](100) NOT NULL,
 CONSTRAINT [PK_company] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[customerType]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[customerType](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[typeCode] [varchar](50) NOT NULL,
	[typeName] [varchar](50) NOT NULL,
 CONSTRAINT [PK_customerType] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[nac]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[nac](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[custName] [varchar](50) NOT NULL,
	[mobile] [varchar](20) NULL,
	[email] [varchar](50) NULL,
	[city] [varchar](50) NULL,
	[createTime] [varchar](20) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_nac] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[nacpx]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[nacpx](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[custName] [varchar](50) NULL,
	[mobile] [varchar](20) NULL,
	[email] [varchar](50) NULL,
	[city] [varchar](50) NULL,
	[createTime] [varchar](20) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_nacpx] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[signup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[signup](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
	[phone] [varchar](50) NULL,
	[email] [varchar](50) NULL,
	[address] [varchar](100) NULL,
	[content] [varchar](400) NULL,
	[bmtime] [varchar](20) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_signup] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[childs]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[childs](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
	[phone] [varchar](50) NULL,
	[email] [varchar](50) NULL,
	[address] [varchar](100) NULL,
	[content] [varchar](400) NULL,
	[bmtime] [varchar](20) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_childs] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[mindPic]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[mindPic](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
	[phone] [varchar](50) NULL,
	[email] [varchar](50) NULL,
	[address] [varchar](100) NULL,
	[content] [varchar](400) NULL,
	[bmtime] [varchar](50) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_mindPic] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[product]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[product](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[proName] [varchar](100) NULL,
	[price] [varchar](50) NULL,
	[linkUrl] [varchar](100) NULL,
	[expandType] [varchar](10) NULL,
	[logoUrl] [varchar](100) NULL,
	[normalMoney] [varchar](50) NULL,
	[advancedMoney] [varchar](50) NULL,
	[createTime] [varchar](20) NULL,
 CONSTRAINT [PK_product] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[mmorder]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[mmorder](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[orderNumber] [varchar](50) NULL,
	[productName] [varchar](50) NULL,
	[subscriber] [varchar](50) NULL,
	[mobile] [varchar](50) NULL,
	[address] [varchar](50) NULL,
	[referral] [varchar](50) NULL,
	[amount] [varchar](50) NULL,
	[status] [varchar](5) NULL,
	[createTime] [varchar](20) NULL,
	[userSno] [varchar](100) NULL,
	[isPay] [varchar](2) NULL,
	[payNo] [varchar](100) NULL,
	[payAmount] [varchar](50) NULL,
	[memo] [varchar](2000) NULL,
 CONSTRAINT [PK_mmorder] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[bulletin]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[bulletin](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[title] [varchar](200) NULL,
	[content] [text] NULL,
	[createTime] [varchar](20) NULL,
 CONSTRAINT [PK_bulletin] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[mmuser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[mmuser](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userName] [varchar](50) NULL,
	[passWord] [varchar](50) NOT NULL,
	[email] [varchar](50) NOT NULL,
	[qq] [varchar](50) NULL,
	[mobile] [varchar](50) NULL,
	[platForm] [varchar](50) NULL,
	[account] [varchar](50) NULL,
	[type] [varchar](2) NULL CONSTRAINT [DF_mmuser_type]  DEFAULT ((0)),
	[createTime] [varchar](20) NULL,
	[amount] [varchar](50) NULL CONSTRAINT [DF_mmuser_amount]  DEFAULT ((0)),
	[userCode] [varchar](50) NULL,
	[expandCode] [varchar](50) NULL,
	[userSno] [varchar](50) NULL,
	[amountTotal] [money] NULL CONSTRAINT [DF_mmuser_amountTotal]  DEFAULT ((0)),
	[amountTotalHistory] [money] NULL CONSTRAINT [DF_mmuser_amountTotalHistory]  DEFAULT ((0)),
 CONSTRAINT [PK_mmuser] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[customerAttributes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[customerAttributes](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[customerId] [varchar](50) NOT NULL,
	[state] [varchar](50) NULL,
	[signature] [int] NULL,
	[signTime] [varchar](20) NULL,
	[amount] [money] NULL,
	[payTime] [varchar](20) NULL,
 CONSTRAINT [PK_customerAttributes] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tgtopimages]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tgtopimages](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[title] [varchar](100) NULL,
	[url] [varchar](200) NULL,
	[linkUrl] [varchar](200) NULL,
 CONSTRAINT [PK_tgtopimages] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[swdt]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[swdt](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
	[phone] [varchar](50) NULL,
	[email] [varchar](50) NULL,
	[address] [varchar](100) NULL,
	[content] [varchar](400) NULL,
	[bmtime] [varchar](50) NULL,
	[isFlag] [int] NULL,
	[memo] [varchar](200) NULL,
	[userSno] [varchar](50) NULL,
 CONSTRAINT [PK_swdt] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[menu]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[menu](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[keyName] [varchar](100) NOT NULL,
	[title] [varchar](100) NULL,
	[formType] [varchar](15) NULL,
	[sortNumber] [int] NULL,
	[layer] [int] NULL,
	[isActive] [int] NULL,
	[isFirstItem] [int] NULL,
	[url] [varchar](200) NULL,
	[accessSno] [varchar](2000) NULL,
	[accessName] [varchar](2000) NULL,
	[target] [varchar](10) NULL,
	[headImage] [varchar](100) NULL,
	[createTime] [varchar](20) NULL,
	[memo] [varchar](1000) NULL,
 CONSTRAINT [PK_menu] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[baseuser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[baseuser](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[USERNAME] [varchar](50) NOT NULL,
	[NICKNAME] [varchar](50) NOT NULL,
	[PASSWORD] [varchar](50) NOT NULL,
	[ROLEID] [varchar](50) NOT NULL,
	[ACCESSSNO] [varchar](2000) NULL,
	[PHONE] [varchar](20) NULL,
	[ADDRESS] [varchar](100) NULL,
	[COMPANYID] [varchar](50) NULL,
	[POSITION] [varchar](50) NULL,
	[CREATETIME] [varchar](50) NULL,
	[ISAUDIT] [int] NOT NULL CONSTRAINT [DF_baseuser_ISAUDIT]  DEFAULT ((0)),
 CONSTRAINT [PK_baseuser] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[mmfile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[mmfile](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[fileName] [varchar](100) NULL,
	[fileUrl] [varchar](200) NULL,
	[accessSno] [varchar](2000) NULL,
	[createTime] [varchar](20) NULL,
 CONSTRAINT [PK_mmfile] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
